//
//  BoutiqueCollectionViewCell.m
//  kr_36
//
//  Created by lmt on 16/1/23.
//  Copyright © 2016年 www.lanou3g.com 蓝鸥科技. All rights reserved.
//

#import "BoutiqueCollectionViewCell.h"

@implementation BoutiqueCollectionViewCell

- (void)dealloc
{
    [_img release];
    [_title release];
    [_xian release];
    [_biaoqian release];
    [_fenlei release];
    [_shijian release];
    [_time release];
    
    [super dealloc];
}

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        self.img = [[UIImageView alloc] init];
        //_img.backgroundColor = [UIColor redColor];
        [self.contentView addSubview:_img];
        [_img release];
        
        self.title = [[UILabel alloc] init];
        //_title.backgroundColor = [UIColor yellowColor];
        _title.font = [UIFont systemFontOfSize:15];
        [self.contentView addSubview:_title];
        _title.numberOfLines = 0;
        [_title release];
        
        self.xian = [[UIView alloc] init];
        _xian.backgroundColor = [UIColor grayColor];
        [self.contentView addSubview:_xian];
        [_xian release];
        
        self.biaoqian = [[UIImageView alloc] init];
        _biaoqian.image = [UIImage imageNamed:@"biaoqian@2x"];
        [self.contentView addSubview:_biaoqian];
        [_biaoqian release];
        
        self.fenlei = [[UILabel alloc] init];
        //_fenlei.backgroundColor = [UIColor magentaColor];
        _fenlei.font = [UIFont systemFontOfSize:12];
        [self.contentView addSubview:_fenlei];
        [_fenlei release];
        
        self.shijian = [[UIImageView alloc] init];
        _shijian.image = [UIImage imageNamed:@"time@2x"];
        [self.contentView addSubview:_shijian];
        [_shijian release];
        
        self.time = [[UILabel alloc] init];
        //_time.backgroundColor = [UIColor redColor];
        _time.font = [UIFont systemFontOfSize:12];
        [self.contentView addSubview:_time];
        [_time release];
        
    }
    return self;
}

- (void)applyLayoutAttributes:(UICollectionViewLayoutAttributes *)layoutAttributes
{
    [super applyLayoutAttributes:layoutAttributes];
    
    _img.frame = CGRectMake(0, 0, layoutAttributes.size.width, 100);
    
    _title.frame = CGRectMake(0, 100, layoutAttributes.size.width, 60);
    
    _xian.frame = CGRectMake(0, 161, layoutAttributes.size.width, 1);
    
    _biaoqian.frame = CGRectMake(5, 165, 15, 15);
    
    _fenlei.frame = CGRectMake(30, 165, 50, 20);
    
    _shijian.frame = CGRectMake(layoutAttributes.size.width - 80, 165, 15, 15);
    
    _time.frame = CGRectMake(layoutAttributes.size.width - 60, 165, 60, 20);
}

@end
